/*
 * @Author: deng da chao
 * @Date: 2022-06-06 09:30:34
 * @LastEditTime: 2023-02-23 09:58:29
 * @Description: 订单信息
 */
import http from '../../utils/http'



// nft平台-直购下单前置接口,缓存数据
const postOrderNftCreateBefore = (data) => {
  return http.post('/order/orderMain/nftCreateBefore', data)
}

// nft平台-获取令牌
const postRedisRaterLimiter = (data) => {
  return http.post('/common/redisRaterLimiter', data)
}

// nft平台-直购下单
const postOrderNftCreate = (data) => {
  return http.post('/order/orderMain/nftCreate', data)
}

// 赠送前置接口
const giveNftBefore = (data) => {
  return http.post('/member/sysMemberBalance/giveNftBefore', data)
}


// NFT转卖商品前置接口
const getSellBefore = (data) => {
  return http.get(`/member/sysMemberNft/publishSellConfig`, data)
}

// 转赠配置(漫谷)
const getPublishSendConfig = (data) => {
  return http.get(`/member/sysMemberNft/publishSendConfig`, data)
}

// 赠送商品
const postSysMemberBalanceGiveNft = (data) => {
  return http.post('/member/sysMemberBalance/giveNft', data)
}
// 获取当前是否有被赠送的商品
const getReceiveIntegralList = (data) => {
  return http.get('/member/sysMember/getReceiveIntegralList', data)
}

// 获取订单列表
const getOrderMainList = (data) => {
  return http.get('/order/orderMain/list', data)
}
// 获取订单详情/photo/api/v1/order/orderMain/orderDetail
const orderDetail = (data) => {
  return http.get('/order/orderMain/orderDetail', data)
}


// 我的商品列表
const getSysMemberNftList = (data) => {
  return http.get('/member/sysMemberNft/list', data)
}

// 查询订单是否支付成功
const getOrderStatusById = (data) => {
  return http.get('/order/orderMain/queryOrder', data)
}


// 开箱前置获取积分抵扣相关信息
const postOrderGetOpenLuckyBagIntegralInfo = (data) => {
  return http.post(`/order/orderRecord/getOpenLuckyBagIntegralInfo`, data)
}

// 福袋下单并调用支付接口
const postOrderOpenLuckyBag = (data) => {
  return http.post(`/order/orderRecord/openLuckyBag`, data)
}

// 修改订单开箱状态
const postUpdateOrderBlessingBagStatus = (data) => {
  return http.post(`/order/orderRecord/updateOrderBlessingBagStatus`, data)
}


// 直购、开箱下单后支付未成功继续支付
const postOrderMainPay = (data) => {
  return http.post(`/order/orderMain/pay`, data)
}

// 直购、开箱下单后支付未成功继续支付-0720继续支付可以选择支付方式改版
const postOrderMainPayV2 = (data) => {
  return http.post(`/order/orderMain/payV2`, data)
}

// 查询是否存在待支付订单
const getOrderMainGetUnPayOrder = (data) => {
  return http.get(`/order/orderMain/getUnPayOrder`, data)
}

// 取消订单
const postOrderMainCancelOrder = (data) => {
  return http.get(`/order/orderMain/cancelOrder`, data)
}

// 查询我得仓库列表
const getSysMemberNftListAllNft = (data) => {
  return http.get(`/member/sysMemberNft/warehouse`, data)
}

// 查询对应我得商品明细
const postSysMemberNftDetailPersonal = (data) => {
  return http.post(`/member/sysMemberNft/detail/personal`, data)
}

// 查询取消转卖前置接口,给出转卖次数和时间
const getCancelSellBefore = (data) => {
  return http.get(`/member/sysMemberNft/cancelSellBefore/${data.memberNftId}`, data)
}

// 空投记录
const getNftPrizeGrantRecord = (data) => {
  return http.get(`/nft/prizeGrantRecord`, data)
}

// 空投记录详情
const getNftPrizeGrantRecordDetail = (data) => {
  return http.get(`/nft/prizeGrantRecordDetail`, data)
}

//获取可使用的方案
const getValidSchemas = (data) => {
  return http.get(`/nft/getValidSchemas`, data)
}

//nft平台-新直购下单
const postPlaceNftOrder = (data) => {
  return http.post(`/order/orderMain/placeNftOrder`, data)
}

//nft平台-选择购买组合直购下单
const postPaySource = (data) => {
  return http.post(`/order/orderMain/paySource`, data)
}

//获取订单额外掉落
const getOrderRandomFallingByOrderId = (data) => {
  return http.get(`/order/orderMain/getOrderRandomFallingByOrderId`, data)
}

//查看组合支付明细
const getCombinationPaymentDetails = (data) => {
  return http.get(`/order/orderMain/combinationPaymentDetails`, data)
}

// 记录行为验证码时间
const getCreateNftOrderBefore = (data) => {
  return http.get(`/order/orderMain/createNftOrderBefore`, data)
}

// 获取已发货订单详情/ldpre/api/v1/delivery/realProductsDeliverRecord/detail/{realProductsRecordId}
const realProductsRecordId = (data) => {
  return http.get(`/delivery/realProductsDeliverRecord/detail/${data}`)
}

// 查看物流订单/photo/api/v1/order/orderMain/logisticsDetail
const logisticsDetail = (data) => {
  return http.get(`/order/orderMain/logisticsDetail`,data)
}


// 统一下单(开箱下单-集市下单-首发订单)
const postUnifiedOrder = (data) => {
  return http.post(`/order/orderMain/unifiedOrder`, data)
}



// 加入购物车
const postCartAdd = (data) => {
  return http.post(`/cart/add`, data)
}

//购物车列表
const getCartCartList = (data) => {
  return http.get(`/cart/cartList`, data)
}


//移除购物车
const postCartCartDel = (data) => {
  return http.post(`/cart/del`, data)
}

// 仓库分类(漫谷)

const getWarehouseCate = (data) => {
  return http.get(`/member/sysMemberNft/warehouseCate`, data)
}

// 仓库详情
const getWarehouseItemDetail = (data) => {
  return http.get(`/member/sysMemberNft/warehouseItemDetail`, data)
}

// 修改提货信息/photo/api/v1/order/orderMain/updExtractAddr
const updExtractAddr = (data) => {
  return http.post(`/order/orderMain/updExtractAddr`, data)
}

// 执行转赠/photo/api/v1/nft/transfer/do
const transferDo = (data) => {
  return http.post(`/nft/transfer/do`, data)
}

export default {
  postOrderNftCreateBefore,
  postOrderNftCreate,
  giveNftBefore,
  getSellBefore,
  getPublishSendConfig,
  postSysMemberBalanceGiveNft,
  getReceiveIntegralList,
  getOrderMainList,
  getSysMemberNftList,
  getOrderStatusById,
  postOrderGetOpenLuckyBagIntegralInfo,
  postOrderOpenLuckyBag,
  postUpdateOrderBlessingBagStatus,
  postOrderMainPay,
  getOrderMainGetUnPayOrder,
  postOrderMainPayV2,
  postOrderMainCancelOrder,
  postRedisRaterLimiter,
  getSysMemberNftListAllNft,
  postSysMemberNftDetailPersonal,
  getCancelSellBefore,
  getNftPrizeGrantRecord,
  getNftPrizeGrantRecordDetail,
  getValidSchemas,
  postPlaceNftOrder,
  postPaySource,
  getOrderRandomFallingByOrderId,
  getCombinationPaymentDetails,
  getCreateNftOrderBefore,
  realProductsRecordId,
  logisticsDetail,
  postUnifiedOrder,
  orderDetail,
  postCartAdd,
  getCartCartList,
  postCartCartDel,
  getWarehouseCate,
  getWarehouseItemDetail,
  updExtractAddr,
  transferDo
}
